function HashMap() {
	/** Map 大小 * */
	var size = 0;
	/** 对象 * */
	var entry = new Object();

	/** 存 * */
	this.put = function(key, value) {
		if (!this.containsKey(key)) {
			size++;
		}
		entry[key] = value;
	}

	/** 取 * */
	this.get = function(key) {
		return this.containsKey(key) ? entry[key] : null;
	}

	/** 删除 * */
	this.remove = function(key) {
		if (this.containsKey(key) && (delete entry[key])) {
			size--;
		}
	}

	/** 是否包含 Key * */
	this.containsKey = function(key) {
		return (key in entry);
	}

	/** 是否包含 Value * */
	this.containsValue = function(value) {
		for ( var prop in entry) {
			if (entry[prop] == value) {
				return true;
			}
		}
		return false;
	}

	/** 所有 Value * */
	this.values = function() {
		var values = new Array();
		for ( var prop in entry) {
			values.push(entry[prop]);
		}
		return values;
	}

	/** 所有 Key * */
	this.keys = function() {
		var keys = new Array();
		for ( var prop in entry) {
			keys.push(prop);
		}
		return keys;
	}

	/** Map Size * */
	this.size = function() {
		return size;
	}

	/* 清空 */
	this.clear = function() {
		size = 0;
		entry = new Object();
	}
}
function Collection() {
	var elements = new Array();	
	this.toArray = function() {
		return elements;
	}
	this.add = function(element) {
	}
	this.addAll = function(c) {
		if(c){			
			if(c.constructor.toString().match(/function HashSet/)){			
				for(var i=0;i<c.size();i++){
					this.add(c.get(i));
				}
			}else if(c.constructor.toString().match(/Array/)){
				for(var i=0;i<c.length;i++){
					this.add(c[i]);
				}
			}
		}
	}
	this.remove = function(element) {
		if (this.indexOf(element) != -1) {
			elements.splice(this.indexOf(element), 1);
		}
	}
	this.removeAll=function(c){
		if(c){			
			if(c.constructor.toString().match(/function HashSet/)){			
				for(var i=0;i<c.size();i++){
					this.remove(c.get(i));
				}
			}else if(c.constructor.toString().match(/Array/)){
				for(var i=0;i<c.length;i++){
					this.remove(c[i]);
				}
			}
		}				
	}
	this.get = function(index) {
		if (0 <= index && index <= this.size() - 1) {
			return elements[index];
		} else {
			return null;
		}
	}
	this.contains = function(element) {
		return this.indexOf(element) > -1;
	}
	this.size = function() {
		return elements.length;
	}
	this.indexOf = function(element) {
		for ( var i = 0; i < elements.length; i++) {
			if (elements[i] == element)
				return i;
		}
		return -1;
	}
	this.empty=function(){
		elements.length=0;
	}
}
function HashSet() {
	Collection.call(this);
	this.add = function(element) {
		if (this.indexOf(element) == -1) {
			this.toArray().push(element);
		}
	}
}
function List() {
	Collection.call(this);
	this.add = function(element) {
		this.toArray().push(element);
	}
}